<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>下单成功，请支付</title>
</head>
<script type="text/javascript" src="jquery-3.5.1.min.js"></script>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        setInterval(refreshTime, 1000);
    })

    let time = 10;

    function refreshTime() {
        if (time <= 0) {
            window.location.href = "/failorder/[(${payId})]";
        }
        $("#time").text("剩余时间：" + time + "s")
        time -= 1;
    }

    function pay() {
        window.location.href = "/pay/[(${payId})]";
    }

</script>
<body>
<span id="time"></span><br>
<a href="javascript:pay()">用户支付</a>
</body>
</html>